package com.example.androidframework.ui.course.dialog

import android.view.View
import com.example.androidframework.R
import com.example.androidframework.databinding.ItemEmojiBinding
import com.martin.lib_base.annotation.ItemData
import com.martin.lib_base.base.BaseViewHolder
import com.martin.lib_base.bean.EmojiBean
import com.martin.lib_base.interfaces.IItemData

@ItemData(EmojiViewHolder.Companion.ItemData::class)
class EmojiViewHolder(view: View) : BaseViewHolder<EmojiBean, ItemEmojiBinding>(view) {
    override fun onBindViewHolder(position: Int, item: Any?) {
        // 设置数据
        getItemBean(item)?.run {
            binding.tv.text = parseToKey()
        }
        // 点击事件
        itemView.setOnClickListener {
            notifyItemClick()
        }
    }

    companion object {
        class ItemData : IItemData {
            override fun getItemLayoutId(): Int {
                return R.layout.item_emoji
            }

        }
    }
}